package com.ycuwq.datepicker.interpolator;

/**
 * Anticipate interpolator
 */
public class AnticipateInterpolator extends BaseInterpolator {
    /**
     * M tension
     */
    private final float mTension;

    /**
     * Anticipate interpolator
     */
    public AnticipateInterpolator() {
        mTension = 2.0f;
    }

    /**
     * Anticipate interpolator
     *
     * @param tension tension
     */
    public AnticipateInterpolator(float tension) {
        mTension = tension;
    }

    /**
     * Get interpolation float
     *
     * @param input input
     * @return the float
     */
    public float getInterpolation(float input) {
        return input * input * ((mTension + 1) * input - mTension);
    }


}

